package org.wanho.shop.mapper;

import org.wanho.shop.entity.User;
import org.wanho.util.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Author：汤小洋
 * Date：2023-04-26 9:40
 * Description：<描述>
 */
public class UserMapper implements RowMapper<User> {
    @Override
    public User mapRow(ResultSet rs) throws SQLException {
        User user = new User();
        user.setId(rs.getInt("id"));
        user.setUsername(rs.getString("username"));
        user.setPassword(rs.getString("password"));
        user.setPhone(rs.getString("phone"));
        user.setAddress(rs.getString("address"));
        return user;
    }
}
